<?php
//pizza店
class PizzaStore {
    /**根据type类型 创建不同的pizza
     * @param $type
     * @return $pizza
     */
    public function create($type) {
        $pizza = null;
        switch ($type)
        {
            case 'liulian' :
                $pizza = new LiulianPizza();
                break;
            case 'egg' :
                $pizza = new EggPizza();
                break;
        }
        if (empty($pizza))
        {
            echo "请选择pizza<br>";
        }

        $pizza->prepare();
        $pizza->bake();
        $pizza->box();
        return $pizza;
    }
}